<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title>人员列表</title>

    <link rel="shortcut icon" href="favicon.ico"> <link href="__PUBLIC__/Theme1/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="__PUBLIC__/Theme1/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">

    <!-- Data Tables -->
    <link href="__PUBLIC__/Theme1/css/plugins/dataTables/dataTables.bootstrap.css" rel="stylesheet">

    <link href="__PUBLIC__/Theme1/css/animate.min.css" rel="stylesheet">
    <link href="__PUBLIC__/Theme1/css/style.min.css?v=4.1.0" rel="stylesheet">
	<link href="__PUBLIC__/Theme1/css/newstyle.css" rel="stylesheet">

</head>

<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>考勤列表 <a href="__URL__/clockIn" style="margin-left:15px; color:#06cbc4">打考勤</a></h5>
                        <div class="ibox-tools">
                            <a class="collapse-link">
                                <i class="fa fa-chevron-up"></i>
                            </a>
                            <a class="close-link">
                                <i class="fa fa-times"></i>
                            </a>
                        </div>
                    </div>
					
					<div class="ibox-content">
					<form method="post" action="__URL__/lists" class="form-horizontal" id="searchForm" enctype="multipart/form-data">
						<div class="form-group">
							<label class="col-sm-1 control-label">条件查询：姓名</label>
							<div class="col-sm-3">
								<input type="text" name="stName" id="stName" value="<{$stName}>" class="form-control">
							</div>
							<label class="col-sm-1 control-label">身份证号</label>
							<div class="col-sm-3">
								<input type="text" name="stIDCard" id="stIDCard" value="<{$stIDCard}>" placeholder="请输入身份证号" class="form-control">
							</div>
						</div>
						<div class="form-group">
							<!--<label class="col-sm-1 control-label">时间范围</label>
                            <div class="col-sm-2" style="width:12%">
                                <input type="date" name="startdate" id="startdate" value="<{$startdate}>" class="form-control">
                            </div>
							<label class="col-sm-1 control-label" style="width:inherit;padding: 7px 4px;">~</label>
							<div class="col-sm-2" style="width:12%">
                                <input type="date" name="enddate" id="enddate" value="<{$enddate}>" class="form-control">
                            </div>-->
                                <label class="col-sm-1 control-label">性别</label>
                                <div class="col-sm-3">
                                    <label class="checkbox-inline">
                                        <input type="radio" value="1"  name="stSex" <if condition="$stSex eq 1">checked</if> > 男</label>
                                    <label class="checkbox-inline">
                                        <input type="radio" value="2" name="stSex" <if condition="$stSex eq 2">checked</if> > 女</label>
                                </div>	
						</div>
						
                        <div class="form-group">
                                <label class="col-sm-1 control-label">所属地区</label>
								<div class="col-sm-7" >
                               	<select class="selectRegione"  name="regione1" >
								<php>
									if(count($regione1)>1){
										echo "<option value='0'>请选择</option>";
									}
								</php>
									<foreach name="regione1" item="val" key="k" >
										<option value="<{$val.id}>" <if condition="$val.id eq $regione1id">selected = "selected"</if>><{$val.name}></option>
									</foreach>
								</select>

								<select class="selectRegione"  name="regione2" <php>if(empty($regione2)){</php>style="display: none"<php>}</php> >
									<php>if(empty($regione2)){</php>
									<option value="0">请选择</option>
									<php>}else{
										if(count($regione2)>1){
										echo "<option value='0'>请选择</option>";
										}
									</php>
									<foreach name="regione2" item="val" key="k">
										<option value="<{$val.id}>" <if condition="$val.id eq $regione2id">selected = "selected"</if>><{$val.name}></option>
									</foreach>
									<php>}</php>
								</select>

								<select class="selectRegione"  name="regione3" <php>if(empty($regione3)){</php>style="display: none"<php>}</php>>
									<php>if(empty($regione3)){</php>
									<option value="0">请选择</option>
									<php>}else{
										if(count($regione3)>1){
										echo "<option value='0'>请选择</option>";
										}
									</php>
									<foreach name="regione3" item="val" key="k">
										<option value="<{$val.id}>" <if condition="$val.id eq $regione3id">selected = "selected"</if>><{$val.name}></option>
									</foreach>
									<php>}</php>
								</select>

								<select class="selectRegione"  name="regione4" <php>if(empty($regione4)){</php>style="display: none"<php>}</php>>
									<php>if(empty($regione4)){</php>
									<option value="0">请选择</option>
									<php>}else{
										if(count($regione4)>1){
										echo "<option value='0'>请选择</option>";
										}
									</php>
									<foreach name="regione4" item="val" key="k">
										<option value="<{$val.id}>" <if condition="$val.id eq $regione4id">selected = "selected"</if>><{$val.name}></option>
									</foreach>
									<php>}</php>
								</select>
								<!--小组-->
								<select class="selectRegione"  name="xiaozu" <php>if(empty($xiaozulist)){</php>style="display: none"<php>}</php>>
									<php>if(empty($xiaozulist)){</php>
									<option value="0">请选择</option>
									<php>}else{
										if(count($xiaozulist)>1){
										echo "<option value='0'>请选择</option>";
										}
									</php>
									<foreach name="xiaozulist" item="val" key="k">
										<option value="<{$val.dId}>" <if condition="$val.dId eq $xiaozu">selected = "selected"</if> ><{$val.dName}></option>
									</foreach>
									<php>}</php>
								</select>
								</div>
                        </div>
						<div class="form-group">
							<label class="col-sm-1 control-label">考勤类型</label>
							<div class="col-sm-3">
								<select class="chosen-select form-control" size="1"
										name="kabout" id="kabout" required>
									<option value="-1">请选择类型</option>
									<foreach name="rs_kabout" item="valkabout" key="kaboutk">
										<option value="<{$kaboutk}>" <if condition="$kaboutk eq $kabout">selected = "selected"</if> ><{$valkabout}></option>
									</foreach>
								</select>
							</div>
						</div>

						<div class="form-group">
							<label class="col-sm-1 control-label">统计方式</label>
							<div class="col-sm-7" >
								<select class="selectRegione"  name="search_type" >
									<option value="year"  <if condition="$search_type eq 'year' ">selected = "selected"</if>>按年统计</option>
									<option value="month" <if condition="$search_type eq 'month' ">selected = "selected"</if>>按照月统计</option>
									<option value="week" <if condition="$search_type eq 'week' ">selected = "selected"</if>>按照周统计</option>
								</select>
								<select class="selectRegione"  name="search_year">
									<for start="2017" end="2025" name="i">
										<option value="<{$i}>" <if condition="$search_year eq $i ">selected = "selected"</if> ><{$i}></option>
									</for>
								</select>
								<select class="selectRegione"  name="search_month" <php>if(empty($search_type)||$search_type=="year"){</php> style="display: none"<php>;}</php> >
									<for start="1" end="13" name="i">
										<option value="<{$i}>" <if condition="$search_month eq $i ">selected = "selected"</if> ><{$i}></option>
									</for>
								</select>
								<select class="selectRegione"  name="search_week"  <php>if(empty($search_type)||$search_type!="week"){</php> style="display: none"<php>;}</php> >
									<option value="<{$search_week}>"   ><{$search_week}></option>
								</select>
							</div>
						</div>

                            <div class="form-group">
                                <div class="col-sm-4 col-sm-offset-2">
                                    <button class="btn btn-primary" id="search" type="button">查询</button>
									<input type="hidden" name="isDownload" id="isDownload" value="0">
									<input name="page" type="hidden" />
									<button class="btn btn-primary" id="getExcel" type="button">导出</button>
                                </div>
                            </div>
					</form>
					</div>

					<div  id="chart2" style="margin: 20px;"></div>

                    <form method="post" action="__URL__/DelAll" class="form-horizontal" id="form-admin-add">
                    <script type="text/javascript">
                    function CheckAll(val) {
                        $("input[name='node[]']").each(function() {
                            this.checked = val;
                        });
                    }
                    </script>


                    <div class="ibox-content">
                        <table class="table table-striped table-bordered table-hover dataTables-example">

                            <thead>
                                <tr>
									<if condition="(session('aPowers') lt 2)"><th></th></if>
                                    <th >姓名</th>
                                    <th >打卡时间</th>
									<th >录入系统时间</th>
									<th >打卡类型</th>
									<th >是否正常打卡</th>
									<th >补卡操作时间</th>
									<th >补卡原因</th>
                                </tr>
                            </thead>
                            <tbody>
                 <foreach name="rs_kaoqinLists" item="val_kaoqinLists">
                <tr class="text-c">
					<if condition="(session('aPowers') lt 2)"><td><input type="checkbox" name="node[]" value="<{$val_kaoqinLists.kId}>"></td></if>
                <td ><{$val_kaoqinLists.stName}></td>
				<php>
				$ktime=date("Y-m-d H:i-s",$val_kaoqinLists['ktime']);
				</php>
                <td ><{$ktime}></td>
				<php>
				$addtime=date("Y-m-d H:i-s",$val_kaoqinLists['addtime']);
				</php>
                <td ><{$addtime}></td>
				<php>
					$kabout=$rs_kabout[$val_kaoqinLists['kabout']];
				</php>
				<td ><{$kabout}></td>
				<if condition="$val_kaoqinLists.kType eq 1">
                <td>补充打卡</td>
                <else/>
                <td>正常打卡</td>
                </if>
				
				<php>
				if(empty($val_kaoqinLists['repairTime'])){
					$repairTime="无";
				}else
					$repairTime=date("Y-m-d H:i-s",$val_kaoqinLists['repairTime']);
				</php>
                <td ><{$repairTime}></td>
				
				<td ><{$val_kaoqinLists.reason}></td>

                
            </tr>
            </foreach>
                            </tbody>
                            
                        </table>
						<div class="page"><{$page}></div>
						<if condition="(session('aPowers') lt 2)">
                        <input type='checkbox' id='chkAll' onclick="CheckAll(this.checked)"> <span style="margin-right: 10px;color: #2c86da; font-size: 12px; font-weight: bold">全 选</span>
                        <input class="btn btn-success btn-xs" type="submit" value="删除" onclick="if(confirm('确定删除?')==false)return false;">
						</if>
                    </div>
                    </form>
                </div>

            </div>
        </div>
    </div>

    <script src="__PUBLIC__/Theme1/js/jquery.min.js?v=2.1.4"></script>
    <script src="__PUBLIC__/Theme1/js/bootstrap.min.js?v=3.3.6"></script>
    <script src="__PUBLIC__/Theme1/js/plugins/jeditable/jquery.jeditable.js"></script>
    <script src="__PUBLIC__/Theme1/js/plugins/dataTables/jquery.dataTables.js"></script>
    <script src="__PUBLIC__/Theme1/js/plugins/dataTables/dataTables.bootstrap.js"></script>
    <script src="__PUBLIC__/Theme1/js/content.min.js?v=1.0.0"></script>

	<script language="JavaScript" type="text/javascript" src="__PUBLIC__/Theme1/js/jqplot/jqplot/jquery.jqplot.min.js"></script>
	<script language="JavaScript" type="text/javascript" src="__PUBLIC__/Theme1/js/jqplot/jqplot/examples/syntaxhighlighter/scripts/shCore.min.js"></script>
	<script language="JavaScript" type="text/javascript" src="__PUBLIC__/Theme1/js/jqplot/jqplot/examples/syntaxhighlighter/scripts/shBrushJScript.min.js"></script>
	<script language="JavaScript" type="text/javascript" src="__PUBLIC__/Theme1/js/jqplot/jqplot/examples/syntaxhighlighter/scripts/shBrushXml.min.js"></script>
	<script language="JavaScript" type="text/javascript" src="__PUBLIC__/Theme1/js/jqplot/jqplot/plugins/jqplot.logAxisRenderer.min.js"></script>
	<script language="JavaScript" type="text/javascript" src="__PUBLIC__/Theme1/js/jqplot/jqplot/plugins/jqplot.canvasTextRenderer.min.js"></script>
	<script language="JavaScript" type="text/javascript" src="__PUBLIC__/Theme1/js/jqplot/jqplot/plugins/jqplot.canvasAxisLabelRenderer.min.js"></script>
	<script language="JavaScript" type="text/javascript" src="__PUBLIC__/Theme1/js/jqplot/jqplot/plugins/jqplot.canvasAxisTickRenderer.min.js"></script>
	<script language="JavaScript" type="text/javascript" src="__PUBLIC__/Theme1/js/jqplot/jqplot/plugins/jqplot.dateAxisRenderer.min.js"></script>
	<script language="JavaScript" type="text/javascript" src="__PUBLIC__/Theme1/js/jqplot/jqplot/plugins/jqplot.categoryAxisRenderer.min.js"></script>
	<script language="JavaScript" type="text/javascript" src="__PUBLIC__/Theme1/js/jqplot/jqplot/plugins/jqplot.barRenderer.min.js"></script>
	<script language="JavaScript" type="text/javascript" src="__PUBLIC__/Theme1/js/jqplot/jqplot/plugins/jqplot.pointLabels.min.js"></script>
	<script language="JavaScript" type="text/javascript" src="__PUBLIC__/Theme1/js/jqplot/jqplot/plugins/jqplot.dateAxisRenderer.min.js"></script>
	<script language="JavaScript" type="text/javascript" src="__PUBLIC__/Theme1/js/jqplot/jqplot/plugins/jqplot.dateAxisRenderer.min.js"></script>
	<script language="JavaScript" type="text/javascript" src="__PUBLIC__/Theme1/js/jqplot/jqplot/plugins/jqplot.highlighter.min.js"></script>

	<link class="include" rel="stylesheet" type="text/css" href="__PUBLIC__/Theme1/js/jqplot/jqplot/jquery.jqplot.min.css" />
	<link type="text/css" rel="stylesheet" href="__PUBLIC__/Theme1/js/jqplot/jqplot/examples/syntaxhighlighter/styles/shCoreDefault.min.css" />
	<link type="text/css" rel="stylesheet" href="__PUBLIC__/Theme1/js/jqplot/jqplot/examples/syntaxhighlighter/styles/shThemejqPlot.min.css" />



	<script type="text/javascript">
		function gopage(page){
			$("[name='page']").val(page);
			$("#searchForm").submit();
		};
		//选择考勤类型
		$("[name='search_type']").change(function(){
			var search_type = $("[name='search_type']").val();
			if(search_type=="year"){
				$("[name='search_month']").hide();
				$("[name='search_week']").hide();
			}else if(search_type=="month")
			{

				$("[name='search_month']").show();
				$("[name='search_week']").hide();
			}else if(search_type=="week")
			{
				$("[name='search_month']").show();
				$("[name='search_week']").show();
				$("[name='search_month']").change();
			}
		});
		//更新周数组
		$("[name='search_month']").change(function(){
			var year = $("[name='search_year']").val();
			var month = $("[name='search_month']").val();
			$("[name='search_week']").html('');
			$.getJSON('/Personnelsystem/Kaoqin/getweekofmonth',{year:year,month:month},function(data){
				if(data != null){
					for(var i = 0; i < data.length; i++) {
						$("[name='search_week']").append('<option value="'+data[i].key+'">'+data[i].val+'</option>');
					}
				}
			});
		});
	</script>
	<script type="text/javascript">
		var chartdate=<{$chartdate}>;
		var userlist = chartdate.userlist;
		var data = chartdate.ratelist;
		var data_max = 100; //Y轴最大刻度
		var line_title = ["考勤"]; //曲线名称
		var y_label = "出勤率"; //Y轴标题
		var x_label = "共计<{$userSum}>人"; //X轴标题
		//var x = ['周一','周二','周三','周四']; //定义X轴刻度值
		var x =chartdate.datelist;  //x轴数据名称
		var title = "考勤统计"; //统计图标标题
		$.jqplot('chart2',data,{
			title: title,
			legend:{show:true,labels: line_title},
			animate:true,
			seriesDefaults: {
				renderer: $.jqplot.BarRenderer, // 利用渲染器（BarRenderer）渲染现有图表
				pointLabels: { show: true }
			},
			axes:{
				yaxis:{
					label: y_label==null?"":y_label,
					max:data_max,
					tickOptions: {
						formatString: "%d%"
					}
				},
				xaxis:{
					renderer: $.jqplot.CategoryAxisRenderer, // 设置横（纵）轴上数据加载的渲染器,
					ticks: x,
					label: x_label==null?"":x_label,
				}
			},
			series:[{color:'#067FCB'}],
			highlighter: {
				show: true,
				sizeAdjust:1,
				shadowAlpha:1,
				tooltipContentEditor:tooltipContentEditor
			},
		});
		//提示框中显示自定义数据
		function tooltipContentEditor(str, seriesIndex, pointIndex, plot) {
			// 显示series_label, x-axis_tick, y-axis 数据
			//return plot.series[seriesIndex]["label"] + ", " + plot.data[seriesIndex][pointIndex];
			var html="<table border='1' class='usersTable'><tr><th>最多签到</th><th>人均签到</th></tr>";
				html+="<tr><td>"+userlist[pointIndex]['max']+"次</td><td>"+userlist[pointIndex]['average']+"次</td></tr>";
				html+="</table>";
			return html;
		}
	</script>
<SCRIPT type="text/javascript">
$(function(){
	$("#getExcel").click(function(){
		$("#isDownload").val(1);
		$("#searchForm").submit();
	});
	$("#search").click(function(){
		$("#isDownload").val(0);
		$("#searchForm").submit();
	});

	//当第一个选择时，给第二填充数据	
	$("[name='regione1']").change(function(){
		$("[name='regione2']").html('<option value="0">加载中...</option>');
		$("[name='regione3']").html('');$("[name='regione3']").hide();
		$("[name='regione4']").html('');$("[name='regione4']").hide();
		$("[name='xiaozu']").html('');$("[name='xiaozu']").hide();
		var id=$(this).val();
		var html='<option value="0">请选择</option>';
		$.ajax({    //ajax方法获取选定区域的下级区域列表
			url:"/Personnelsystem/Department/getChildId",
			data:{id:id},
			dataType:'json',
			type:'post',
			success:function(re){
				var html='<option value="0">请选择</option>';
				var item=re;
				for(var i in item){
					html +='<option value="'+item[i]['id']+'" >'+item[i]['name']+'</option>';
				}
				$("[name='regione2']").html(html);
				$("[name='regione2']").show();
			}
		})
	});
	//当第2个选择时，给第3填充数据
	$("[name='regione2']").change(function(){
		$("[name='regione3']").html('<option value="0">加载中...</option>');
		$("[name='regione4']").html('');$("[name='regione4']").hide();
		$("[name='xiaozu']").html('');$("[name='xiaozu']").hide();
		var id=$(this).val();
		var html='<option value="0">请选择</option>';
		$.ajax({    //ajax方法获取选定区域的下级区域列表
			url:"/Personnelsystem/Department/getChildId",
			data:{id:id},
			dataType:'json',
			type:'post',
			success:function(re){
				var html='<option value="0">请选择</option>';
				var item=re;
				for(var i in item){
					html +='<option value="'+item[i]['id']+'" >'+item[i]['name']+'</option>';
				}
				$("[name='regione3']").html(html);
				$("[name='regione3']").show();
			}
		})
	});
	//当第3个选择时，给第4填充数据
	$("[name='regione3']").change(function(){
		$("[name='regione4']").html('<option value="0">加载中...</option>');
		$("[name='xiaozu']").html('');$("[name='xiaozu']").hide();
		var id=$(this).val();
		var html='<option value="0">请选择</option>';
		$.ajax({    //ajax方法获取选定区域的下级区域列表
			url:"/Personnelsystem/Department/getChildId",
			data:{id:id},
			dataType:'json',
			type:'post',
			success:function(re){
				var html='<option value="0">请选择</option>';
				var item=re;
				for(var i in item){
					html +='<option value="'+item[i]['id']+'" >'+item[i]['name']+'</option>';
				}
				$("[name='regione4']").html(html);
				$("[name='regione4']").show();
			}
		})
	});
	
	//当选择村时，获取组信息
	$("[name='regione4']").change(function(){
		$("[name='xiaozu']").html('<option value="0">加载中...</option>');
		var id=$(this).val();
		var html='<option value="0">请选择</option>';
		$.ajax({    //ajax方法获取选定区域的下级区域列表
			url:"/Personnelsystem/Staff/getxiaozuInfo",
			data:{id:id},
			dataType:'json',
			type:'post',
			success:function(re){
				var html='<option value="0">请选择</option>';
				var item=re;
				for(var i in item){
					html +='<option value="'+item[i]['dId']+'" >'+item[i]['dName']+'</option>';
				}
				$("[name='xiaozu']").html(html);
				$("[name='xiaozu']").show();
			}
		})
	});
})

</SCRIPT>
	<script>
		$(document).ready(function(){
		//	$(".dataTables-example").dataTable();
		});

	</script>


</body>

</html>
